<%@ LANGUAGE="VBSCRIPT" %>
<% option explicit%>
<% Response.Expires=0 
dim aa, bb,cc
''aa=Request.ServerVariables("LOGON_USER")
''cc=Request.Querystring("AN")
''if instr(1,aa, cc,1)=0 THEN
''response.clear
''response.end
''end if

''aa=Request.ServerVariables("HTTP_USER_AGENT")
''bb="Indy"
''if instr(1,aa, bb,1)=0  THEN
''response.clear
''response.end
''end if
%>
<!--METADATA NAME="Microsoft ActiveX Data Objects 2.5 Library" TYPE="TypeLib" UUID="{00000205-0000-0010-8000-00AA006D2EA4}"-->
<%
dim Node, Token, AN, CN, DTA, DE,  Cd, Art, Price
Node=request("Node")
if isEmpty(Node) then Node="_P"
Token=request("Token")
if isEmpty(Token) then Token=""
CN=request("CN")
if isEmpty(CN) then CN=""
DTA=request("DTA")
if isEmpty(DTA) then DTA=""
AN=request("AN")
if isEmpty(AN) then AN=""
DE=request("DE")
if isEmpty(DE) then DE=1
Cd=request("Cd")
if isEmpty(Cd) then Cd="No"
Art=request("Art")
if isEmpty(Art) then Art="0"
Price=request("Price")
if isEmpty(Price) then Price="0"

	Dim cnn
	Dim connStr
	dim cmd
	dim R
	Set cnn=Server.CreateObject("ADODB.Connection")
    Set cmd=Server.CreateObject("ADODB.Command")
%>
<!-- #INCLUDE FILE="Connection.inc" -->
<%
''''	connStr="Provider=SQLOLEDB.1;Persist Security Info=True;User ID=Test;Password=Test;Initial Catalog=SMS"&Node&";Data Source=EM-HOME"
	cnn.open connStr
	Set cmd.ActiveConnection = cnn
	cmd.CommandType=adCmdStoredProc
	cmd.CommandText = "sp_VendorAutomat"

	Cmd.Parameters.Append Cmd.CreateParameter("@AN", adVarChar, adParamInput,24)
	''Cmd.Parameters.Append Cmd.CreateParameter("@Phone", adVarChar, adParamInput,20)
	Cmd.Parameters.Append Cmd.CreateParameter("@Token", adVarChar, adParamInput,20)
	Cmd.Parameters.Append Cmd.CreateParameter("@Code", adVarChar, adParamInput,10)
	Cmd.Parameters.Append Cmd.CreateParameter("@DEMO", adInteger, adParamInput)
	Cmd.Parameters.Append Cmd.CreateParameter("@CN", adVarChar, adParamInput,160)
	Cmd.Parameters.Append Cmd.CreateParameter("@Art", adVarChar, adParamInput,16)
	Cmd.Parameters.Append Cmd.CreateParameter("@Price", adVarChar, adParamInput,16)
	Cmd.Parameters.Append Cmd.CreateParameter("@DTA", adVarChar, adParamInput,20)
	Cmd.Parameters.Append Cmd.CreateParameter("@Res", adInteger, adParamOutput)
	Cmd.Parameters.Append Cmd.CreateParameter("@Result", adVarChar, adParamOutput,160)
	Cmd("@AN")=AN
	''Cmd("@Phone")=Ph
	Cmd("@Token")=Token
	Cmd("@Code")=Cd
	Cmd("@DEMO")=De
	Cmd("@CN")=CN
	Cmd("@Art")=Art
	Cmd("@Price")=Price
	Cmd("@DTA")=DTA
	cmd.execute
	%><RESULT>
<%=Cmd("@Result")%>
</RESULT>
<%
	set cmd=nothing
	cnn.close
	set cnn=nothing
%>
